package com.blog.controller;

import com.blog.service.BaseMenuService;
import com.blog.system.Menu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/menu")
public class BaseMenuController {
    @Autowired
    BaseMenuService baseMenuService;
    @GetMapping("/menus")
    public List<Menu> getMenus(){
        return baseMenuService.getMenus();
    }
    @GetMapping("/allMenus")
    public  List<Menu> getAllMenus(){
        return baseMenuService.getAllMenus();
    }
    @GetMapping("/menuRid/{rid}")
    public List<Integer> getMenuByRId(@PathVariable Integer rid){
        return baseMenuService.getMenuByRId(rid);
    }
}
